<script>
	export default {
		globalData: {

		},

		onLaunch: function(option) {
			// account 传值代表iOS能用
			if (uni.getSystemInfoSync().platform == 'android') {
				// AndroidFunction.loadFinish();
			} else {

				try {
					window.webkit.messageHandlers.loadFinish.postMessage('');
				} catch (e) {
					//TODO handle the exception
				}

			}
			
			if (option.query.account) {
				uni.setStorageSync('account', option.query.account);
			} else {
				uni.setStorageSync('account', false);
			}

			if (option.query.version) {
				uni.setStorageSync('version', option.query.version);
			}


			this.$nextTick(() => {
				// 获取安全区域的顶部高度
				document.getElementsByTagName('body')[0].style.setProperty('--paging-head-top',
					`${ option.query.navHeight || 44 }px`);
				uni.setStorageSync('nav_height', option.query.navHeight || 44)
				console.log(`${window.location.href}`);
				// console.log(`\n %c 获取原生传递的导行栏安全区--------${option.query.navHeight}`,
				// 	'background-color:#f60;color:#fff; padding: 10px; border-radius: 5px;line-height: 40px');
				// console.log(`\n %c 获取原生参数--------${JSON.stringify(option.query)}`,
				// 	'background-color:#789;color:pink; padding: 10px; border-radius: 5px;line-height: 40px');
			})

		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
	}
</script>

<style lang="scss">
	@import "uview-ui/index.scss";
	@import "@/utils/public.css";

	.uni-system-choose-location {
		.nav {
			padding-top: var(--paging-head-top) !important;

			.nav-btn {
				top: var(--paging-head-top);
			}
		}
	}
</style>